package com.interview.demo.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="demo")
public class DemoController {

	@RequestMapping(value = "list", method = { RequestMethod.GET })
	public String toList(ModelMap model) {
		
		return "demo/list";
	}
	
	@RequestMapping(method = RequestMethod.GET )
	@ResponseBody
	public Object getData(){
		Map<String,String> result = new HashMap<String,String>();
		result.put("name","yanch");
		result.put("age","31");
		return result;
	}
}
